import buttionRender from "@/components/aggridCellRenDerer/buttionRender.vue";

const tableColumns = [
    {
        field: '',
        headerCheckboxSelection: true,
        checkboxSelection: true,
        width: 50,
        showDisabledCheckboxes: false,
        pinned: 'left',
    },
    {
        headerName: '项目编号',
        field: 'projectCode',
        width: 150,
    },
    {
        headerName: '点检项目',
        field: 'projectName',
        width: 150,
    },
    {
        headerName: '机台类型',
        field: 'machineType',
        width: 150,
        valueGetter: (params: any) => {
            return params.data.spotCheckProjectMachineTypeList.reduce((sum: any, cur: any) => sum + cur.machineType + ',', '').slice(0, -1)
        }
    },
    {
        headerName: '调机类型',
        field: 'adjustmentType',
        width: 150,
        valueGetter: (params: any) => {
            return params.data.spotCheckProjectAdjustmentTypeList.reduce((sum: any, cur: any) => sum + cur.adjustmentType + ',', '').slice(0, -1)
        }
    },
    {
        headerName: '创建人',
        field: 'createName',
        width: 150,
    },
    {
        headerName: '创建时间',
        field: 'createTime',
        width: 150,
    },
    {
        headerName: '最后修改人',
        field: 'updateName',
        width: 150,
    },
    {
        headerName: '最后修改时间',
        field: 'updateTime',
        width: 150,
    },
    {
        headerName: '操作',
        field: 'action',
        width: 150,
        cellRenderer: buttionRender,
        cellRendererParams: {
            buttonList: [
                {
                    type: 'success',
                    text: '修改',
                    typeName: 'el-button',
                    show: true,
                    Callback: (data: any) => {
                        editHandler(data)
                    },
                },
            ],
            eltagSize: 0,
        },
    }
]

export default tableColumns